We queried the transactions' gas costs in 80,000 blocks (block height range {12.86M, 12.94M}). The reuslts include gas costs under both post-Berlin and post-Verkle gas schedule. In the charts the following are presented:
In the following histograms, for the same range of blocks and regarding the post-Verkle gas schedule, we present detailed information for the distribution of transactions over
In the following histograms, for the same range of blocks and regarding the post-Verkle gas schedule, we present detailed information for the distribution of contracts over
For this analysis we adopted a worst-case-scenario approach, considering each contract to be "represented" by the most expensive, gas-wise, transaction that called it.
To reduce the code access penalty Dr.Neville Grech suggested an alternate code chunk accessing scheme. Since many smart contracts are deployed multiple times with the same code, addressing the code by the codehash rather than by the contract address would allow the bytecode to be re-used without charging extra.
Currently the code chunk access uses the following mechanism;
(address, (chunk_id + 128) // 256, (chunk_id + 128) % 256)
This mechanism would remain in place for the first 128 chunk_id used for code, where after the following access scheme is used;
(address, (chunk_id - 128) // 256, (chunk_id - 128) % 256)
To assess the impacts of these changes analyses were run on ~8000 blocks from block 12.93M to 12.94M.
The 8185 blocks studied contained a total of 974719 outer transactions, from these 42110 benefitted and 195 performed worse. The proposal therefore positively impacts 4.3% of transactions and negatively impacts 0.0002%.
With ~4% of transactions effected by the change it is worth establishing the margin of improvement for these effected transactions. From the computed histogram the majority of the transactions fall into the 5-10% improvement bracket with the overall average sitting at an ~8% margin of improvement.
Average Savings 0 0.08834
The following histogram provides detailed information about the gas savings (%) of the analysed transactions.
To confirm the assumption that the code chunking benefits transactions that interact with multiple deployed versions of the same contract, we can filter for transactions which have fewer unique codehash interactions than address interactions. In the example below we filter for contracts which interact with 3 times more addresses than code hashes, which causes the average savings to jump from ~8% to ~36%.
Average Savings 0 0.366974